|
|
Find the errors in the Programs!!!
Can You Fix All The Errors?
Try Solving These Problems Without the Compiler First
Then, If You Get Really Stumped, Try Using the IC Compiler
Problem 1 Rank: Easy (5 Errors)
void main()
{
motor(0 100);
motor(1 100)
printf(john is cool);
}
Problem 2 Rank: Easy (2 Errors)
void main()
{
readenc1;
readenc2;
readenc1 = read_encoder(1);
readenc2 = read_encoder(2);
}
Problem 3 Rank: Easy (4 Errors)
void main
{
int encoder1;
int encoder2;
moter(0,100);
moter(1,100);
sleep(2);
}
Problem 4 Rank: Medium (4 Errors)
void main()
{
while(1);
{
move_at_velocity(500,1);
move_at_velocity(500,2);
}
ao();
Problem 5 Rank: Medium (5 Errors)
void main()
{
int motor1;
int motor2;
motor1 = get_motor_position_counter;
motor2 = get_motor_position_counter;
printf("%d" motor1 "/n");
}
Hint: one error is a logic error
Problem 6 Rank: Hard (4 Errors)
Part 1 Program name = "XBCstraight.ic"
#use "goForward"
void main()
{
goForward(0,1,500,1000);
}
Part 2 program name = "goForward.ic"
void goForward(motor1,motor2,speed,Clicks)
{
int motorPosition;
motorPosition = get_motor_position_counter(motor1);
while(motorPosition <= clicksL)
{
mav(motor1,speed);
mav(motor2,speed);
}
}
Hint: When XBC straight is run, it ends up kind of like the energizer
bunny...There seems to be a logic error somewhere...
Webpage designed by John "The Zigmaster" Ziegler
|
|